.class final Lcom/tendcloud/tenddata/fu;
.super Ljava/lang/Object;


# static fields
.field static final b:Ljava/lang/String; = "ev1.xdrig.com"

.field static final c:Ljava/lang/String;

.field static final d:Ljava/lang/String; = "v1"

.field static final e:Ljava/lang/String; = "https"

.field static final f:Ljava/lang/String; = "https://ev1.xdrig.com/smsauth/v1/"

.field private static final g:I = 0x4e20

.field private static h:J

.field private static i:Lcom/tendcloud/tenddata/TalkingDataSMSApplyCallback;

.field private static j:Lcom/tendcloud/tenddata/TalkingDataSMSVerifyCallback;

.field private static k:Ljava/lang/String;

.field private static volatile l:Lcom/tendcloud/tenddata/fu;


# instance fields
.field a:Ljava/util/HashMap;


# direct methods
.method static constructor <clinit>()V
    .locals 3

    const/4 v2, 0x0

    sput-object v2, Lcom/tendcloud/tenddata/fu;->c:Ljava/lang/String;

    const-wide/16 v0, 0x0

    sput-wide v0, Lcom/tendcloud/tenddata/fu;->h:J

    sput-object v2, Lcom/tendcloud/tenddata/fu;->i:Lcom/tendcloud/tenddata/TalkingDataSMSApplyCallback;

    sput-object v2, Lcom/tendcloud/tenddata/fu;->j:Lcom/tendcloud/tenddata/TalkingDataSMSVerifyCallback;

    const-string v0, ""

    sput-object v0, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    sput-object v2, Lcom/tendcloud/tenddata/fu;->l:Lcom/tendcloud/tenddata/fu;

    return-void
.end method

.method constructor <init>()V
    .locals 1

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lcom/tendcloud/tenddata/fu;->a:Ljava/util/HashMap;

    return-void
.end method

.method static a()Lcom/tendcloud/tenddata/fu;
    .locals 2

    sget-object v0, Lcom/tendcloud/tenddata/fu;->l:Lcom/tendcloud/tenddata/fu;

    if-nez v0, :cond_1

    const-class v1, Lcom/tendcloud/tenddata/fu;

    monitor-enter v1

    :try_start_0
    sget-object v0, Lcom/tendcloud/tenddata/fu;->l:Lcom/tendcloud/tenddata/fu;

    if-nez v0, :cond_0

    new-instance v0, Lcom/tendcloud/tenddata/fu;

    invoke-direct {v0}, Lcom/tendcloud/tenddata/fu;-><init>()V

    sput-object v0, Lcom/tendcloud/tenddata/fu;->l:Lcom/tendcloud/tenddata/fu;

    :cond_0
    monitor-exit v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :cond_1
    sget-object v0, Lcom/tendcloud/tenddata/fu;->l:Lcom/tendcloud/tenddata/fu;

    return-object v0

    :catchall_0
    move-exception v0

    :try_start_1
    monitor-exit v1
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v0
.end method

.method private a(Ljava/lang/String;ILjava/lang/String;)V
    .locals 2

    const/4 v1, 0x0

    const-string v0, "verify"

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    sget-object v0, Lcom/tendcloud/tenddata/fu;->j:Lcom/tendcloud/tenddata/TalkingDataSMSVerifyCallback;

    if-eqz v0, :cond_1

    sget-object v0, Lcom/tendcloud/tenddata/fu;->j:Lcom/tendcloud/tenddata/TalkingDataSMSVerifyCallback;

    invoke-direct {p0, p1, p2, p3, v0}, Lcom/tendcloud/tenddata/fu;->a(Ljava/lang/String;ILjava/lang/String;Lcom/tendcloud/tenddata/TalkingDataSMSVerifyCallback;)V

    sput-object v1, Lcom/tendcloud/tenddata/fu;->j:Lcom/tendcloud/tenddata/TalkingDataSMSVerifyCallback;

    :cond_0
    :goto_0
    return-void

    :cond_1
    const-string v0, "apply"

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    sget-object v0, Lcom/tendcloud/tenddata/fu;->i:Lcom/tendcloud/tenddata/TalkingDataSMSApplyCallback;

    if-eqz v0, :cond_0

    sget-object v0, Lcom/tendcloud/tenddata/fu;->i:Lcom/tendcloud/tenddata/TalkingDataSMSApplyCallback;

    invoke-direct {p0, p1, p2, p3, v0}, Lcom/tendcloud/tenddata/fu;->a(Ljava/lang/String;ILjava/lang/String;Lcom/tendcloud/tenddata/TalkingDataSMSApplyCallback;)V

    sput-object v1, Lcom/tendcloud/tenddata/fu;->i:Lcom/tendcloud/tenddata/TalkingDataSMSApplyCallback;

    goto :goto_0
.end method

.method private a(Ljava/lang/String;ILjava/lang/String;Lcom/tendcloud/tenddata/TalkingDataSMSApplyCallback;)V
    .locals 7

    :try_start_0
    sget-object v0, Lcom/tendcloud/tenddata/TalkingDataSMS;->c:Landroid/os/Handler;

    if-eqz v0, :cond_0

    sget-object v6, Lcom/tendcloud/tenddata/TalkingDataSMS;->c:Landroid/os/Handler;

    new-instance v0, Lcom/tendcloud/tenddata/fv;

    move-object v1, p0

    move-object v2, p1

    move-object v3, p4

    move v4, p2

    move-object v5, p3

    invoke-direct/range {v0 .. v5}, Lcom/tendcloud/tenddata/fv;-><init>(Lcom/tendcloud/tenddata/fu;Ljava/lang/String;Lcom/tendcloud/tenddata/TalkingDataSMSApplyCallback;ILjava/lang/String;)V

    invoke-virtual {v6, v0}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    :goto_0
    return-void

    :cond_0
    const-string v0, "TalkingDataSDK"

    const-string v1, "The method of initSMS has not be called or init failed."

    invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method private a(Ljava/lang/String;ILjava/lang/String;Lcom/tendcloud/tenddata/TalkingDataSMSVerifyCallback;)V
    .locals 7

    :try_start_0
    sget-object v0, Lcom/tendcloud/tenddata/TalkingDataSMS;->c:Landroid/os/Handler;

    if-eqz v0, :cond_0

    sget-object v6, Lcom/tendcloud/tenddata/TalkingDataSMS;->c:Landroid/os/Handler;

    new-instance v0, Lcom/tendcloud/tenddata/fw;

    move-object v1, p0

    move-object v2, p1

    move-object v3, p4

    move v4, p2

    move-object v5, p3

    invoke-direct/range {v0 .. v5}, Lcom/tendcloud/tenddata/fw;-><init>(Lcom/tendcloud/tenddata/fu;Ljava/lang/String;Lcom/tendcloud/tenddata/TalkingDataSMSVerifyCallback;ILjava/lang/String;)V

    invoke-virtual {v6, v0}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    :goto_0
    return-void

    :cond_0
    const-string v0, "TalkingDataSDK"

    const-string v1, "The method of initSMS has not be called or init failed."

    invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method private c()Z
    .locals 3

    iget-object v0, p0, Lcom/tendcloud/tenddata/fu;->a:Ljava/util/HashMap;

    const-string v1, "mobile"

    invoke-virtual {v0, v1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v0

    const-string v1, "[0-9]*"

    invoke-static {v1}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;

    move-result-object v1

    invoke-virtual {v1, v0}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/regex/Matcher;->matches()Z

    move-result v0

    iget-object v1, p0, Lcom/tendcloud/tenddata/fu;->a:Ljava/util/HashMap;

    const-string v2, "countryCode"

    invoke-virtual {v1, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v1

    const-string v2, "[0-9]*"

    invoke-static {v2}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;

    move-result-object v2

    invoke-virtual {v2, v1}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;

    move-result-object v1

    invoke-virtual {v1}, Ljava/util/regex/Matcher;->matches()Z

    move-result v1

    if-eqz v0, :cond_0

    if-eqz v1, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private d()[B
    .locals 7

    const/4 v0, 0x0

    :try_start_0
    new-instance v1, Lorg/json/JSONObject;

    const-string v2, "JSON"

    invoke-static {v2}, Lcom/tendcloud/tenddata/fx;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    :try_start_1
    const-string v2, "action"

    invoke-virtual {v1, v2}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v2

    const-string v3, "domain"

    const-string v4, "sms"

    invoke-virtual {v2, v3, v4}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string v3, "name"

    sget-object v4, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    invoke-virtual {v2, v3, v4}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    new-instance v3, Ljava/util/HashMap;

    invoke-direct {v3}, Ljava/util/HashMap;-><init>()V

    const-string v4, "mobile"

    iget-object v5, p0, Lcom/tendcloud/tenddata/fu;->a:Ljava/util/HashMap;

    const-string v6, "mobile"

    invoke-virtual {v5, v6}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-interface {v3, v4, v5}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-string v4, "secretId"

    sget-object v5, Lcom/tendcloud/tenddata/fx;->j:Ljava/lang/String;

    invoke-interface {v3, v4, v5}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-string v4, "countryCode"

    iget-object v5, p0, Lcom/tendcloud/tenddata/fu;->a:Ljava/util/HashMap;

    const-string v6, "countryCode"

    invoke-virtual {v5, v6}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-interface {v3, v4, v5}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    sget-object v4, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    const-string v5, "verify"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_0

    const-string v4, "securityCode"

    iget-object v5, p0, Lcom/tendcloud/tenddata/fu;->a:Ljava/util/HashMap;

    const-string v6, "securityCode"

    invoke-virtual {v5, v6}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-interface {v3, v4, v5}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    :cond_0
    sget-object v4, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    const-string v5, "apply"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_1

    iget-object v4, p0, Lcom/tendcloud/tenddata/fu;->a:Ljava/util/HashMap;

    const-string v5, "transactionId"

    invoke-virtual {v4, v5}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v4

    if-eqz v4, :cond_1

    const-string v4, "transactionId"

    iget-object v5, p0, Lcom/tendcloud/tenddata/fu;->a:Ljava/util/HashMap;

    const-string v6, "transactionId"

    invoke-virtual {v5, v6}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-interface {v3, v4, v5}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    :cond_1
    const-string v4, "data"

    new-instance v5, Lorg/json/JSONObject;

    invoke-direct {v5, v3}, Lorg/json/JSONObject;-><init>(Ljava/util/Map;)V

    invoke-virtual {v2, v4, v5}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    :try_end_1
    .catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_1

    :goto_0
    if-nez v1, :cond_2

    :goto_1
    return-object v0

    :catch_0
    move-exception v1

    move-object v1, v0

    :goto_2
    sget-object v2, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    const/16 v3, 0x266

    const-string v4, "SMS SDK inner error"

    invoke-direct {p0, v2, v3, v4}, Lcom/tendcloud/tenddata/fu;->a(Ljava/lang/String;ILjava/lang/String;)V

    goto :goto_0

    :cond_2
    invoke-virtual {v1}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/String;->getBytes()[B

    move-result-object v0

    goto :goto_1

    :catch_1
    move-exception v2

    goto :goto_2
.end method


# virtual methods
.method a(Landroid/os/Bundle;)V
    .locals 4

    invoke-static {}, Lcom/tendcloud/tenddata/fx;->a()V

    invoke-static {}, Lcom/tendcloud/tenddata/fx;->b()V

    invoke-static {}, Lcom/tendcloud/tenddata/fx;->c()V

    :try_start_0
    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V

    const-string v1, "appKey"

    sget-object v2, Lcom/tendcloud/tenddata/fx;->i:Ljava/lang/String;

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string v1, "service"

    const-string v2, "sms"

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    sget-object v1, Lcom/tendcloud/tenddata/fx;->e:Lorg/json/JSONObject;

    const-string v2, "appKey"

    new-instance v3, Lorg/json/JSONArray;

    invoke-direct {v3}, Lorg/json/JSONArray;-><init>()V

    invoke-virtual {v3, v0}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray;

    move-result-object v0

    invoke-virtual {v1, v2, v0}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public b()V
    .locals 7

    const/4 v1, 0x0

    :try_start_0
    invoke-direct {p0}, Lcom/tendcloud/tenddata/fu;->c()Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "TalkingDataSDK"

    const-string v1, "The parameter should be number."

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :goto_0
    return-void

    :cond_0
    iget-object v0, p0, Lcom/tendcloud/tenddata/fu;->a:Ljava/util/HashMap;

    const-string v2, "action"

    invoke-virtual {v0, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    sget-object v0, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    const-string v2, "apply"

    invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/tendcloud/tenddata/fu;->a:Ljava/util/HashMap;

    const-string v2, "callback"

    invoke-virtual {v0, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/tendcloud/tenddata/TalkingDataSMSApplyCallback;

    move-object v6, v1

    move-object v1, v0

    move-object v0, v6

    :goto_1
    sget-object v2, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    const-string v3, "apply"

    invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_2

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    sget-wide v4, Lcom/tendcloud/tenddata/fu;->h:J

    sub-long/2addr v2, v4

    const-wide/32 v4, 0xea60

    cmp-long v2, v2, v4

    if-gtz v2, :cond_2

    sget-object v0, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    const/16 v2, 0x263

    const-string v3, "Only one apply request can be handled in 60s."

    invoke-direct {p0, v0, v2, v3, v1}, Lcom/tendcloud/tenddata/fu;->a(Ljava/lang/String;ILjava/lang/String;Lcom/tendcloud/tenddata/TalkingDataSMSApplyCallback;)V
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    sget-object v0, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    const/16 v1, 0x266

    const-string v2, "SMS SDK inner error."

    invoke-direct {p0, v0, v1, v2}, Lcom/tendcloud/tenddata/fu;->a(Ljava/lang/String;ILjava/lang/String;)V

    goto :goto_0

    :cond_1
    :try_start_1
    sget-object v0, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    const-string v2, "verify"

    invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_9

    iget-object v0, p0, Lcom/tendcloud/tenddata/fu;->a:Ljava/util/HashMap;

    const-string v2, "callback"

    invoke-virtual {v0, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/tendcloud/tenddata/TalkingDataSMSVerifyCallback;

    goto :goto_1

    :cond_2
    sget-object v2, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    const-string v3, "verify"

    invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_3

    sget-object v2, Lcom/tendcloud/tenddata/fu;->j:Lcom/tendcloud/tenddata/TalkingDataSMSVerifyCallback;

    if-eqz v2, :cond_3

    sget-object v1, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    const/16 v2, 0x264

    const-string v3, "The verification request is too frequent, please try again later."

    invoke-direct {p0, v1, v2, v3, v0}, Lcom/tendcloud/tenddata/fu;->a(Ljava/lang/String;ILjava/lang/String;Lcom/tendcloud/tenddata/TalkingDataSMSVerifyCallback;)V

    goto :goto_0

    :cond_3
    sget-object v2, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    const-string v3, "apply"

    invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_5

    sput-object v1, Lcom/tendcloud/tenddata/fu;->i:Lcom/tendcloud/tenddata/TalkingDataSMSApplyCallback;

    :cond_4
    :goto_2
    invoke-direct {p0}, Lcom/tendcloud/tenddata/fu;->d()[B

    move-result-object v0

    if-nez v0, :cond_6

    new-instance v0, Ljava/lang/Exception;

    const-string v1, "SMS SDK inner error."

    invoke-direct {v0, v1}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_5
    sget-object v1, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    const-string v2, "verify"

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_4

    sput-object v0, Lcom/tendcloud/tenddata/fu;->j:Lcom/tendcloud/tenddata/TalkingDataSMSVerifyCallback;

    goto :goto_2

    :cond_6
    sget-object v1, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    const-string v2, "apply"

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_7

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    sput-wide v2, Lcom/tendcloud/tenddata/fu;->h:J

    :cond_7
    new-instance v1, Landroid/os/Message;

    invoke-direct {v1}, Landroid/os/Message;-><init>()V

    new-instance v2, Landroid/os/Bundle;

    invoke-direct {v2}, Landroid/os/Bundle;-><init>()V

    const-string v3, "action"

    sget-object v4, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    invoke-virtual {v2, v3, v4}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    sget-object v3, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    const-string v4, "verify"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_8

    const-string v3, "timeout"

    const/16 v4, 0x4e20

    invoke-virtual {v2, v3, v4}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V

    :cond_8
    invoke-virtual {v1, v2}, Landroid/os/Message;->setData(Landroid/os/Bundle;)V

    iput-object v0, v1, Landroid/os/Message;->obj:Ljava/lang/Object;

    sget-object v0, Lcom/tendcloud/tenddata/ga;->a:Landroid/os/Handler;

    invoke-virtual {v0, v1}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
    :try_end_1
    .catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_0

    goto/16 :goto_0

    :cond_9
    move-object v0, v1

    goto/16 :goto_1
.end method

.method public declared-synchronized onResponse(Landroid/os/Bundle;)V
    .locals 5

    const/16 v4, 0xc8

    monitor-enter p0

    :try_start_0
    const-string v0, "action"

    invoke-virtual {p1, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    const-string v1, "SMS"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_3

    const-string v0, "status"

    invoke-virtual {p1, v0}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v2

    if-eq v2, v4, :cond_0

    sget-object v0, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    const-string v1, "apply"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_1

    :cond_0
    sget-object v0, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    const-string v1, "verify"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_2

    if-ne v2, v4, :cond_2

    :cond_1
    const-wide/16 v0, 0x0

    sput-wide v0, Lcom/tendcloud/tenddata/fu;->h:J

    :cond_2
    const-string v0, "message"

    invoke-virtual {p1, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_1
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result-object v3

    const/4 v1, 0x0

    :try_start_1
    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0, v3}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    .catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    :goto_0
    if-eq v2, v4, :cond_5

    :try_start_2
    const-string v1, "errorMessage"

    invoke-virtual {v0, v1}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_5

    const/16 v1, 0x258

    if-ne v2, v1, :cond_4

    sget-object v0, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    const-string v1, "SMS SDK inner error."

    invoke-direct {p0, v0, v2, v1}, Lcom/tendcloud/tenddata/fu;->a(Ljava/lang/String;ILjava/lang/String;)V
    :try_end_2
    .catch Ljava/lang/Throwable; {:try_start_2 .. :try_end_2} :catch_1
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    :cond_3
    :goto_1
    monitor-exit p0

    return-void

    :catch_0
    move-exception v0

    :try_start_3
    sget-object v0, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    const-string v3, "SMS SDK inner error."

    invoke-direct {p0, v0, v2, v3}, Lcom/tendcloud/tenddata/fu;->a(Ljava/lang/String;ILjava/lang/String;)V

    move-object v0, v1

    goto :goto_0

    :cond_4
    sget-object v1, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    const-string v3, "errorMessage"

    invoke-virtual {v0, v3}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-direct {p0, v1, v2, v0}, Lcom/tendcloud/tenddata/fu;->a(Ljava/lang/String;ILjava/lang/String;)V

    goto :goto_1

    :catch_1
    move-exception v0

    goto :goto_1

    :cond_5
    if-ne v2, v4, :cond_3

    const-string v1, "transactionId"

    invoke-virtual {v0, v1}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_3

    sget-object v1, Lcom/tendcloud/tenddata/fu;->k:Ljava/lang/String;

    const-string v3, "transactionId"

    invoke-virtual {v0, v3}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-direct {p0, v1, v2, v0}, Lcom/tendcloud/tenddata/fu;->a(Ljava/lang/String;ILjava/lang/String;)V
    :try_end_3
    .catch Ljava/lang/Throwable; {:try_start_3 .. :try_end_3} :catch_1
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    goto :goto_1

    :catchall_0
    move-exception v0

    :try_start_4
    throw v0
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_1

    :catchall_1
    move-exception v0

    monitor-exit p0

    throw v0
.end method
